public class Test {

    public static void main(String[] args) {
        MySignalLinkedList mySignalLinkedList = new MySignalLinkedList();
        mySignalLinkedList.addFirst(5);
        mySignalLinkedList.addFirst(4);
        mySignalLinkedList.addFirst(3);
        mySignalLinkedList.addFirst(2);
        mySignalLinkedList.addFirst(1);

        mySignalLinkedList.show();
        System.out.println();

//        MySignalLinkedList.ListNode node = mySignalLinkedList.reverseList2();
//        mySignalLinkedList.show(node);

//        mySignalLinkedList.show();

//        MySignalLinkedList.ListNode ret=  mySignalLinkedList.middleNode();
//        System.out.println(ret.val);
        int ret = mySignalLinkedList.kthToLast2(2);
        System.out.println(ret);



    }
    public static void main1(String[] args) {
        MySignalLinkedList mySignalLinkedList = new MySignalLinkedList();
        mySignalLinkedList.addFirst(12);
        mySignalLinkedList.addFirst(23);
        mySignalLinkedList.addFirst(34);
        mySignalLinkedList.addFirst(45);
        mySignalLinkedList.addFirst(56);
        mySignalLinkedList.show();


        System.out.println();
        mySignalLinkedList.clear();
        mySignalLinkedList.show();



    }
}
